package com.example.backendhjh.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;

@Data
public class OrderDTO {
    private Long id;
    private String orderNumber;

    @NotNull(message = "用户ID不能为空")
    private Long userId;

    private BigDecimal totalAmount;

   @NotBlank(message = "订单状态不能为空")
    private String status;

   @NotBlank(message = "收货地址不能为空")
    @Size(max = 255, message = "收货地址长度不能超过255个字符")
    private String shippingAddress;

    @NotBlank(message = "支付方式不能为空")
    private String paymentMethod;

    @NotNull(message = "订单项不能为空")
    @Size(min = 1, message = "至少需要一个订单项")
    private List<OrderItemDTO> orderItems;
}